<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>京东关闭广告</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div img{
            /* float: left; */
            display: block;
        }
        .one{
            position: relative;
            width: 700px;
        }
        .one img{
            width: 700px;
        }
        .two{
            position: absolute;
            top: 0;
            right: 0;
        }
        .two img{
            width: 10px;
            height: 10px;
        }
    </style>
</head>
<body>
    <div class="one">
        <img src="./luzhou.jpg" alt="">
        <div class="two">
            <img src="./close.jpg" alt="">
        </div>
    </div>
    <script>
        //获得元素对象
        var div=document.querySelector('div');
        var pic2=document.querySelector('.two');
        //绑定处理程序
        //关闭广告--整个div隐藏
        pic2.onclick=function(){
            div.style.display='none';
        }
    </script>
</body>
</html>